package com.ideal.manage.esms.repository.project;

import com.ideal.manage.esms.bean.project.AlarmInfo;
import com.ideal.manage.esms.repository.framework.BaseRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface AlarmInfoRepository extends BaseRepository<AlarmInfo,String> {

    @Query("select a from AlarmInfo a where a.objName=?1 and a.isValid=1")
    List<AlarmInfo> findAlarmInfoByType(Integer equipmentType);

    @Query("select a from AlarmInfo a where a.isValid=1")
    List<AlarmInfo> findAlarmInfos();

    @Query("select a.code from AlarmInfo a where a.isValid=1")
    List<AlarmInfo> findByCode();
    @Query("select a from AlarmInfo a where a.isValid=1")
    List<AlarmInfo> findAllAlarms();
}
